<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="./jquery-3.4.1.min.js"></script>
<body>
  <input id="user_id" type="text" value="user_001" hidden="hidden">
  <input id="job_code" type="text" value="code001" hidden="hidden">
  <button id="click" class="action" act_type="click">点击</button>
  <button id="collect" class="action" act_type="job_collect">收藏</button>
  <button id="send" class="action" act_type="cv_send">投简历</button>
  <button id="upload" class="action" act_type="cv_upload">上传简历</button>
  <label id="label"></label>
  </body>
  <style>
      .action {
          height: 30px;
          font-family: 微软雅黑;
          font-size: 14px;
          color: aliceblue;
          border: none;
          border-radius: 4px;
      }
 
      #click {
          background-color: cadetblue;
      }
 
      #collect {
          background-color: cornflowerblue;
      }
 
      #send {
          background-color: coral;
      }
 
      #upload {
          background-color: indianred;
      }
  </style>
  <script>
      $(document).ready(function () {
          $(".action").click(function () {
              var user_id = $("#user_id").val();
              var act_time = new Date();
              var action = this.getAttribute("act_type")
              var job_code = $("#job_code").val();
              var log = user_id + "\t" + act_time + "\t" + action + "\t" + job_code;
              $.ajax({
                  url: "http://linux123:81/kafka/log",
                  type: "POST",
                  dataType: "json",
                  data: log
              })
          });
      })
  </script>
</html>